package com.bizfx.utils
{
	import mx.collections.IList;

	public class ListUtils
	{
		public function ListUtils()
		{
		}
		
		public static function isContains(item:Object, list:IList):Boolean {
			if (!list)
				return false;
			return list.getItemIndex(item) >= 0;
		}
		
		public static function removeFromList(list:IList, item:Object):void {
			if (!list)
				return;
			var index:int = list.getItemIndex(item);
			if (index >= 0) {
				list.removeItemAt(index)
			}
		}
		
		public static function appendFromArray(list:IList, array:Array):void {
			if (list != null && array != null) {
				for (var i:int; i < array.length; i++) {
					list.addItem(array[i]);
				}	
			}
		}
	}
}